package com.lanchetech.dao;

import com.lanchetech.entity.ShoppingCart;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ShoppingCartMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ShoppingCart record);

    int insertSelective(ShoppingCart record);

    ShoppingCart selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ShoppingCart record);

    int updateByPrimaryKey(ShoppingCart record);

    int updateBatch(List<ShoppingCart> list);

    int updateBatchSelective(List<ShoppingCart> list);

    int batchInsert(@Param("list") List<ShoppingCart> list);

    int deleteByUserIdAndSkuId(@Param("userId") Long userId, @Param("skuId") Long skuId);

    Long countByUserId(@Param("userId") Long userId);

    Long sumByUserId(@Param("userId") Long userId);

    List<ShoppingCart> findAllByUserId(@Param("userId") Long userId);

    int deleteByIdAndUserId(@Param("id") Long id, @Param("userId") Long userId);

    int deleteByUserIdAndSkuIds(@Param("userId") Long userId, @Param("skuIds") List<Long> skuIds);

    ShoppingCart findOneByUserIdAndSkuId(@Param("userId") Long userId, @Param("skuId") Long skuId);
}